﻿using System;

namespace MDT_MonitorModel
{
    
    
    public partial class Computer : IComputer
    {
        public String StatusColor
        {
            get
            {
                if(this.Errors!=0){
                    return "Tomato";
                }
                else if (this.Warnings != 0)
                {
                    return "Orange";
                }
                else
                {
                    return "DarkCyan";
                }
            }
        }

        public string Type
        {
            get
            {
                return "Computers";
            }
        }

        public int StatusId
        {
            get
            {
                if (this.Errors != 0)
                    return 0;
                else if (this.Warnings != 0)
                    return 1;
                else
                    return 2;
            }
        }

        public String Status
        {
            get
            {
                if (this.Errors != 0)
                    return "Error";
                else if (this.Warnings != 0)
                    return "Warning";
                else
                    return DeploymentStatusStr;
            }
        }

        public String DeploymentStatusStr
        {
            get
            {
                switch (DeploymentStatus)
                {
                    case 1: return "Running";
                    case 2: return "Failled";
                    case 3: return "Completed";
                    case 4: return "Unresponsive";
                    default: return "Unknown status";
                }
            }
        }

        public string Id
        {
            get
            {
                return Name;
            }
        }

        public string Image
        {
            get
            {
               return "ms-appx:///Assets/surface.png";
            }
        }

        public string PercentCompleteStr
        {
            get
            {
                return this.PercentComplete.ToString() + "%";
            }
        }
        
        public string data1String { get { return "Nb Errors/Warnings:";} }
        public string data1Text { 
            get {
                if (this.Errors != 0)
                    return this.Errors.ToString();
                else if (this.Warnings != 0)
                    return this.Warnings.ToString();
                else
                {
                    return "0";
                }    
            } 
        }

        public string data2String { get { return ""; } }
        public string data2Text { get { return ""; } }

        public string data3String { get { return ""; } }
        public string data3Text { get { return ""; } }

        public object sort1 { get { return this.Errors; } }
        public object sort2 { get { return this.Warnings; } }
        public object sort3 { get { return this.PercentComplete; } }
    }
}
